/**
 * Bestpay.com.cn Inc.
 * Copyright (c) 2011-2019 All Rights Reserved.
 */
package com.suxiaoxiao.springbootlearn.spring.framework.customizer;

import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * desc
 *
 * @author zhaorongzhang
 * @version WebMvcCustomizer.java, v 0.1 2019/12/24 1:03 下午 zhaorongzhang Exp $$
 */
@Order(0)
@Component
public class WebMvcCustomizer implements WebServerFactoryCustomizer<TomcatServletWebServerFactory>, Ordered {

    /**
     * 作用类似于 application.yml
     * @param factory
     */
    @Override
    public void customize(TomcatServletWebServerFactory factory) {
//        factory.setPort(9090);
//        factory.setContextPath("/demo");
    }

    /**
     * 执行顺序，越大执行顺序越低。
     * @return
     */
    @Override
    public int getOrder() {
        return 0;
    }

}